define(['framework/constant'], function (constant) {
    var articleService = ['$http', 'API_URL', function ($http, API_URL) {
        this.addArticle = function (model) {
            var req = {
                method: 'post',
                url: API_URL.USER_SERVER + "/core/v1/article",
                data: model
            };
            return $http(req);
        }

        this.getArticles = function (model) {
            var req = {
                method: 'get',
                url: API_URL.USER_SERVER + "/core/v1/articles",
            };
            return $http(req);
        }
    }];

    //引用框架定义的方法
    angular.module("blog").registerService("articleService", articleService);
})